<include file="public@agent_header">
<link href="__STATIC__/css/layui.css" rel="stylesheet" />
<link href="__STATIC__/css/admin.css" rel="stylesheet" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<div class="row">
            <div class="layui-card-body">
              	<div class="layui-carousel layadmin-carousel layadmin-backlog" lay-anim="" lay-indicator="inside" lay-arrow="none" style="width: 100%; height: 160px!important;">
	                <div carousel-item="">
	                  	<ul class="layui-row layui-col-space10 layui-this">
	                    	<li class="layui-col-xs4">
	                      		<a href="javascript:;" class="layadmin-backlog-body">
	                        		<h3>下单总金额</h3>
	                        		<p><cite>{$total_order_amount}</cite>USDT</p>
	                      		</a>
	                    	</li>
	                    	<li class="layui-col-xs4">
	                      		<a href="javascript:;" class="layadmin-backlog-body">
	                        		<h3>今日下单金额</h3>
	                        		<p><cite>{$today_order_amount}</cite>USDT</p>
	                      		</a>
	                    	</li>
	                    	<li class="layui-col-xs4">
		                      	<a href="javascript:;" class="layadmin-backlog-body">
		                        	<h3>本月下单金额</h3>
		                        	<p><cite>{$month_order_amount}</cite>USDT</p>
		                      	</a>
		                    </li>
	                    	<!-- <li class="layui-col-xs4">
	                      		<a href="javascript:;" class="layadmin-backlog-body">
	                        		<h3>总盈亏金额</h3>
	                        		<p><cite>{$total_amount}</cite>USDT</p>
	                      		</a>
	                    	</li>
	                    	<li class="layui-col-xs4">
	                      		<a href="javascript:;" class="layadmin-backlog-body">
	                        		<h3>今日盈亏金额</h3>
	                        		<p><cite>{$today_amount}</cite>USDT</p>
	                      		</a>
	                    	</li>
	                    	<li class="layui-col-xs4">
		                      	<a href="javascript:;" class="layadmin-backlog-body">
		                        	<h3>本月盈亏金额</h3>
		                        	<p><cite>{$month_amount}</cite>USDT</p>
		                      	</a>
		                    </li> -->
	                  	</ul>
	                </div>
            	</div>
          	</div>
        </div>
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('order/index')}">订单列表</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="get" action="{:url('order/index')}">
            用户:
            <input type="text" class="form-control" name="keyword" style="width: 200px;" value="{:input('request.keyword/s','')}" placeholder="手机|邮箱">
            币种:
            <select class="form-control" name="symbol" style="width: 120px;">
				<option value="">---请选择---</option>
				<foreach name="symbol_list" item="vo">
					<option value="{$vo.name}" <if input('symbol') == $vo.name && input('symbol') != null>selected</if> >{$vo.name}</option>
				</foreach>
            </select>
            下单时间:
            <input type="text" class="form-control js-bootstrap-datetime" name="start_time" style="width: 200px;" value="{:input('request.start_time/s','')}" placeholder="开始时间" autocomplete="off">
            -
            <input type="text" class="form-control js-bootstrap-datetime" name="end_time" style="width: 200px;" value="{:input('request.end_time/s','')}" placeholder="结束时间" autocomplete="off">
            下单金额:
            <input type="text" class="form-control" name="start_amount" style="width: 100px;" value="{:input('request.start_amount/s','')}" placeholder="">
            -
            <input type="text" class="form-control" name="end_amount" style="width: 100px;" value="{:input('request.end_amount/s','')}" placeholder="">
            周期:
            <select class="form-control" name="cycle" style="width: 120px;">
				<option value="">---请选择---</option>
				<option value="60" <if input('cycle') == 60 && input('cycle') != null>selected</if> >60s</option>
				<option value="120" <if input('cycle') == 120 && input('cycle') != null>selected</if> >120s</option>
				<option value="300" <if input('cycle') == 300 && input('cycle') != null>selected</if> >300s</option>
            </select>
            开仓方向:
            <select class="form-control" name="direction" style="width: 120px;">
				<option value="">---请选择---</option>
				<option value="1" <if input('direction') == 1 && input('direction') != null>selected</if> >买涨</option>
				<option value="2" <if input('direction') == 2 && input('direction') != null>selected</if> >买跌</option>
            </select>
            状态:
            <select class="form-control" name="status" style="width: 120px;">
				<option value="">---请选择---</option>
				<option value="1" <if input('status') == 1 && input('status') != null>selected</if> >持仓</option>
				<option value="2" <if input('status') == 2 && input('status') != null>selected</if> >成交</option>
            </select>
            盈亏:
            <select class="form-control" name="result" style="width: 120px;">
				<option value="">---请选择---</option>
				<option value="1" <if input('result') == 1 && input('result') != null>selected</if> >赢</option>
				<option value="2" <if input('result') == 2 && input('result') != null>selected</if> >输</option>
            </select>
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:url('order/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>手机</th>
					<th>邮箱</th>
					<th>开仓币种</th>
					<th>下单时间</th>
					<th>下单金额</th>
					<th>周期</th>
					<th>收益率</th>
					<th>开仓价格</th>
					<th>开仓方向</th>
					<th>订单状态</th>
					<th>计划平仓时间</th>
					<th>实际平仓时间</th>
					<th>平仓价格</th>
					<th>平仓盈亏金额</th>
					<th>盈亏</th>
				</tr>
			</thead>
			<tbody>
				<php>$status_text = ['1'=>'持仓','2'=>'成交'];$result_text = ['1'=>'赢','2'=>'输'];</php>
				<foreach name="list" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.mobile}</td>
					<td>{$vo.user_email}</td>
					<td>{$vo.symbol}</td>
					<td>{:date('Y-m-d H:i:s',$vo.create_time)}</td>
					<td>{:floatval($vo.order_amount)}</td>
					<td>{$vo.cycle}s</td>
					<td>{$vo.yield}%</td>
					<td>{:floatval($vo.opening_price)}</td>
					<td>{:lang('direction_text')[$vo.direction]}</td>
					<td>{$status_text[$vo.status]}</td>
					<td>{:date('Y-m-d H:i',$vo.plan_time)}</td>
					<td>{:date('Y-m-d H:i',$vo.closing_time)}</td>
					<td>{:floatval($vo.closing_price)}</td>
					<td>{:floatval($vo.closing_amount)}</td>
					<td>{$result_text[$vo.result]}</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>